/*
 * @Author: taoyuqing
 * @Date: 2022-12-22 20:47:12
 * @Description: 菜单条
 */
import 'package:flutter/material.dart';

import 'image_button.dart';

class MenuBar extends StatelessWidget {
  final Function? onItemTap;
  const MenuBar({Key? key, this.onItemTap}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
      child: Wrap(
        spacing: 10,
        children: [
          ImageButton(
            url: 'images/slots.png',
            btName: 'Slots',
            onTap: () {
              Navigator.pushNamed(context, 'FairnessPage');
            },
          ),
          ImageButton(
            url: 'images/live-casino.png',
            btName: 'Live Casino',
            onTap: () {
              if (onItemTap != null) {
                onItemTap!('live');
              }
            },
          ),
          ImageButton(
            url: 'images/games.png',
            btName: 'Games',
            onTap: () {
              if (onItemTap != null) {
                onItemTap!('games');
              }
            },
          ),
          ImageButton(
            url: 'images/jack-pot.png',
            btName: 'Jackpot',
          ),
          ImageButton(
            url: 'images/promotion.png',
            btName: 'Promotion',
          ),
          ImageButton(
            url: 'images/bonuses.png',
            btName: 'Bonuses',
            onTap: () {
              Navigator.pushNamed(context, 'BonusesPage');
            },
          )
        ],
      ),
    );
  }
}
